<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

//前端路由配置
if (is_file(APP_PATH.'common/install.lock')) {
  $routeNav  = db('nav')->field('entitle')->order('sort,id')->select();
  $routeCate = db('cate')->field('entitle')->order('sort,id')->select();
  Route::rule('search','index/Search/index');
	Route::rule('tag','index/Tag/index');
	Route::rule('tag/:id','index/Tag/index');
  foreach ($routeNav as $key=>$v) {
	  Route::rule($v['entitle'],'index/Article/index');
	  Route::rule($v['entitle'].'/:id','index/Show/index');
  }
  foreach ($routeCate as $key=>$v) {
	  Route::rule($v['entitle'],'index/Article/index');
  }
}